package com.guaoran.micro.services.spring.cloud.eureka.client.user.service.provider.service;

import com.guaoran.micro.services.spring.cloud.eureka.client.user.service.provider.entity.Person;
import com.guaoran.micro.services.spring.cloud.eureka.client.user.service.provider.repository.PersonRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

/**
 * @author : gucheng
 * @Description : <br/>
 * @date :2018/12/9 12:23
 */
@Service
public class PersonService {
    @Autowired
    private PersonRepository repository;

    /**
     * 保存对象
     * @param person
     */
    public void save(Person person){
        repository.save(person);
    }

    /**
     * 分页查询
     * @param pageable
     * @return
     */
    public Page<Person> findListByPage(Pageable pageable){
        return repository.findAll(pageable);
    }
}
